<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>道路车辆智能监测系统</title>
	<link href="css/start/jquery-ui-1.10.3.custom.css" rel="stylesheet" id="mycss">
	<link href="css/rvims.css" rel="stylesheet" >
	<script src="js/jquery-1.9.1.js"></script>
	<script src="js/jquery-ui-1.10.3.custom.js"></script>
	
	<script src="js/common.js"></script>
	<script src="js/control.js"></script>
	<script src="js/dialog.js"></script>
	<script>
		$(function() {
			$( ".datepicker" ).datepicker({
				dateFormat:'yy-mm-dd',
			});
			$("#tabs").tabs();
			setTableCSS("controlVehicles");
			setTableCSS("controlPoints")
			setTableCSS("InformRules");
			$( "button" ).button();
		});
	</script>
	<style type="text/css">
		.fontRed{
			color:red;
		}
	</style>
</head>
<body>
	<div id="maindiv">
		<%@ include file="../common/header.jsp"%>
		<h3>布控任务 >> 维护布控任务</h3>
		<div id="content">
			<span class="fontRed">注:</span>带"<span class="fontRed">*</span>"为必填项
			<form id="frmCTaskEdit" action="saveControlTask.do" method="post">
				<input type="hidden" name="id" value="${controlTask.id }">
				<table>
					<tr>
						<td align="right" style="width:180px;">布控任务名称<span class="fontRed">*</span></td>
						<td colspan="3"><input type="text" width="100%" id="txtCTaskName" name="name" value="${controlTask.name }"></td>
					</tr>
					<tr>
						<td align="right" >任务状态</td>
						<td><input type="checkbox" id="cbCTaskIsUse" name="isUse" ${controlTask.isUse == 1 ? 'checked' : '' } value="1"/>启用布控规则</td>
						<td align="right" >全国布控黑名单</td>
						<td><input type="checkbox" id="cbCtaskIsAll" name="isAll" ${controlTask.isAll == 1 ? 'checked' : '' } value="1"/>使用全国布控名单</td>
					</tr>
					<tr>
						<td align="right" >任务生效时间<span class="fontRed">*</span></td>
						<td><input type="text" class="datepicker" id="strDateBegin" name="strBeginTime" readonly="readonly" value="<fmt:formatDate value='${controlTask.beginTime}' pattern='yyyy-MM-dd'/>"/></td>
						<td align="right" >任务过期时间<span class="fontRed">*</span></td>
						<td><input type="text" class="datepicker" id="strDateEnd" name="strEndTime" readonly="readonly" value="<fmt:formatDate value='${controlTask.endTime}' pattern='yyyy-MM-dd'/>"/></td>
					</tr>
				</table>
				<div id="tabs">
					<ul>
						<li><a href="#controlVehicle">布控车辆</a></li>
						<li><a href="#controlPoint">布控点</a></li>
						<li><a href="#InformRule">告知规则</a></li>
					</ul>
					<div id="controlVehicle">
						<button onclick="showControlVehicleDialog('controlVehicles');return false;">选择布控车辆</button>
						<table id="controlVehicles" >
							<thead>
								<tr>
									<td>号牌号码</td>
									<td>号牌种类</td>
									<td>布控类型</td>
									<td>车辆类型</td>
									<td>备注</td>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${controlTask.listControlVehicle}" var="controlVehicle">
									<tr id="objId_${controlVehicle.id }" ">
										<td><input type="hidden" value="${controlVehicle.id }">${controlVehicle.licencePlate }</td>
										<td>${controlVehicle.licencePlateType.name }</td>
										<td>${controlVehicle.controlType.name }</td>
										<td>${controlVehicle.vehicleType.name }</td>
										<td>${controlVehicle.licencePlateKind.name}</td>
										<td>${controlVehicle.description}</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					<div id="controlPoint">
						<button onclick="showControlPointDialog('controlPoints');return false;">选择布控点</button>
						<table id="controlPoints" >
							<thead>
								<tr>
									<td>名称</td>
									<td>编号</td>
									<td>路段名称</td>
									<td>经度</td>
									<td>维度</td>
								</tr>
							</thead>
							<tbody>	
								<c:forEach items="${controlTask.listControlPoint}" var="controlPoint">
									<tr id="objId_${controlPoint.id }" ">
										<td><input type="hidden" value="${controlPoint.id }">${controlPoint.name }</td>
										<td>${controlPoint.identifier }</td>
										<td>${controlPoint.roadSection.name }</td>
										<td>${controlPoint.longitude }</td>
										<td>${controlPoint.latitude }</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					<div id="InformRule">
						<button onclick="showInformRuleDialog('InformRules');return false;">选择告知规则</button>
						<table id="InformRules" style="min-width:240px;" cellspacing="0" cellpadding="0">
							<thead>
								<tr>
									<td>告知名称</td>
									<td>告知类型</td>
									<td>告知内容</td>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${controlTask.listInformRule}" var="informRule">
									<tr id="objId_${informRule.id }" ">
										<td><input type="hidden" value="${informRule.id }">${informRule.name }</td>
										<td>${informRule.informType.name }</td>
										<td>${informRule.description }</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
				</div>
			</form>
			<div style="width:100%;height:40px;margin-top:20px;">
				<button style="float:left;" onclick="saveControlTask()">保存</button>
				<button style="float:left;margin-left:10px;" onclick="showControlTaskSearch()">关闭</button>
			</div><br/><br/><br/><br/>
			<div id="informDiv" class="fontRed"></div>
		</div>
		<%@ include file="../common/footer.jsp"%>
	</div>
</body>
</html>